<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GPL: gpl::Log类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="coffee_bean_77.268292682927px_1164279_easyicon.net.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GPL
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacegpl.html">gpl</a></li><li class="navelem"><a class="el" href="classgpl_1_1_log.html">Log</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="classgpl_1_1_log-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">gpl::Log类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>日志封装类  
 <a href="classgpl_1_1_log.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="log_8h_source.html">log.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:af85a60f076dd20bba36893c4e51678e7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#af85a60f076dd20bba36893c4e51678e7">Log</a> ()</td></tr>
<tr class="memdesc:af85a60f076dd20bba36893c4e51678e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">log操作类的构造函数，来执行一些初始化操作  <a href="#af85a60f076dd20bba36893c4e51678e7">更多...</a><br /></td></tr>
<tr class="separator:af85a60f076dd20bba36893c4e51678e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a369f22bd7e70b921f08c81a00c875ca9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#a369f22bd7e70b921f08c81a00c875ca9">~Log</a> ()</td></tr>
<tr class="memdesc:a369f22bd7e70b921f08c81a00c875ca9"><td class="mdescLeft">&#160;</td><td class="mdescRight">log操作类的析构函数，来执行一些销毁操作  <a href="#a369f22bd7e70b921f08c81a00c875ca9">更多...</a><br /></td></tr>
<tr class="separator:a369f22bd7e70b921f08c81a00c875ca9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c6625e07231ac6121cf31ee82cfcf99"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#a2c6625e07231ac6121cf31ee82cfcf99">initlog</a> ()</td></tr>
<tr class="memdesc:a2c6625e07231ac6121cf31ee82cfcf99"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化log  <a href="#a2c6625e07231ac6121cf31ee82cfcf99">更多...</a><br /></td></tr>
<tr class="separator:a2c6625e07231ac6121cf31ee82cfcf99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae723c5b414cce412b6f50663100e323c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#ae723c5b414cce412b6f50663100e323c">writeLog</a> (<a class="el" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a> level, const char *format,...)</td></tr>
<tr class="memdesc:ae723c5b414cce412b6f50663100e323c"><td class="mdescLeft">&#160;</td><td class="mdescRight">写日志  <a href="#ae723c5b414cce412b6f50663100e323c">更多...</a><br /></td></tr>
<tr class="separator:ae723c5b414cce412b6f50663100e323c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63c29d14d9475d2dd5a0c1b7533a8341"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#a63c29d14d9475d2dd5a0c1b7533a8341">writeThreadLog</a> (<a class="el" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a> level, const char *format,...)</td></tr>
<tr class="memdesc:a63c29d14d9475d2dd5a0c1b7533a8341"><td class="mdescLeft">&#160;</td><td class="mdescRight">写线程安全日志  <a href="#a63c29d14d9475d2dd5a0c1b7533a8341">更多...</a><br /></td></tr>
<tr class="separator:a63c29d14d9475d2dd5a0c1b7533a8341"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a3ae0cdd38fce4a903c02f922f960a94f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classgpl_1_1_log.html">Log</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgpl_1_1_log.html#a3ae0cdd38fce4a903c02f922f960a94f">Instance</a> ()</td></tr>
<tr class="memdesc:a3ae0cdd38fce4a903c02f922f960a94f"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化log静态对像  <a href="#a3ae0cdd38fce4a903c02f922f960a94f">更多...</a><br /></td></tr>
<tr class="separator:a3ae0cdd38fce4a903c02f922f960a94f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>日志封装类 </p>
<dl class="section author"><dt>作者</dt><dd>DayBreakZhang(<a href="#" onclick="location.href='mai'+'lto:'+'a36'+'53'+'164'+'65'+'@gm'+'ai'+'l.c'+'om'; return false;">a3653<span style="display: none;">.nosp@m.</span>1646<span style="display: none;">.nosp@m.</span>5@gma<span style="display: none;">.nosp@m.</span>il.c<span style="display: none;">.nosp@m.</span>om</a>) </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:28</dd></dl>
<dl class="section attention"><dt>注意</dt><dd>注意 </dd></dl>
<dl class="bug"><dt><b><a class="el" href="bug.html#_bug000002">Bug:</a></b></dt><dd>问题 </dd></dl>
<dl class="section warning"><dt>警告</dt><dd>警告<ul>
<li>输入字符不得超过2048个字符 </li>
</ul>
</dd></dl>
<dl class="section note"><dt>注解</dt><dd>对日志的日常操作<ul>
<li>分级日志输出</li>
<li>分级分文件输出 </li>
</ul>
</dd></dl>

<p>在文件 <a class="el" href="log_8h_source.html">log.h</a> 第 <a class="el" href="log_8h_source.html#l00054">54</a> 行定义.</p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="af85a60f076dd20bba36893c4e51678e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">gpl::Log::Log </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>log操作类的构造函数，来执行一些初始化操作 </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:34 </dd></dl>

</div>
</div>
<a class="anchor" id="a369f22bd7e70b921f08c81a00c875ca9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">gpl::Log::~Log </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>log操作类的析构函数，来执行一些销毁操作 </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:34 </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a2c6625e07231ac6121cf31ee82cfcf99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gpl::Log::initlog </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化log </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:47 </dd></dl>
<dl class="section return"><dt>返回</dt><dd>返回一数值<ul>
<li>0是成功</li>
<li>非0 是失败 </li>
</ul>
</dd></dl>
<dl class="section remark"><dt>备注</dt><dd>初始化化详情<ul>
<li>默认 设置级别高于 google::FATAL 的日志同时输出到屏幕</li>
<li>定义DEBUG_MODE宏 设置级别高于 google::INFO 的日志同时输出到屏幕</li>
<li>设置输出到屏幕的日志显示相应颜色</li>
<li>按照等级区分log文件</li>
<li>缓冲日志输出，立即输出</li>
<li>最大日志大小为 100MB</li>
<li>当磁盘被写满时，停止日志输出 </li>
</ul>
</dd></dl>
<dl class="section see"><dt>参见</dt><dd>参考内容 </dd></dl>

</div>
</div>
<a class="anchor" id="a3ae0cdd38fce4a903c02f922f960a94f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classgpl_1_1_log.html">Log</a>* gpl::Log::Instance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>初始化log静态对像 </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 11:06 </dd></dl>

</div>
</div>
<a class="anchor" id="ae723c5b414cce412b6f50663100e323c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpl::Log::writeLog </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a>&#160;</td>
          <td class="paramname"><em>level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>写日志 </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:53 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">level[outputLogLevel]</td><td>输出日志类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">format[const</td><td>char *] 输出的格式化字符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>void </dd></dl>
<dl class="section pre"><dt>前置条件</dt><dd>level分级<ul>
<li>L_INFO 日常信息</li>
<li>L_WARNING 警告信息</li>
<li>L_ERROR 错误信息</li>
<li>L_FATAL 致命错误 </li>
</ul>
</dd>
<dd>
format格式<ul>
<li>使用printf 中的输出格式 e.g ("printf%s","hello") </li>
</ul>
</dd></dl>
<dl class="section remark"><dt>备注</dt><dd>可以分级写日志，写入到不同的文件里面。 </dd></dl>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0">gpl::logLevel</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a63c29d14d9475d2dd5a0c1b7533a8341"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpl::Log::writeThreadLog </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a>&#160;</td>
          <td class="paramname"><em>level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>写线程安全日志 </p>
<dl class="section date"><dt>日期</dt><dd>2016/06/03 10:53 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">level[outputLogLevel]</td><td>输出日志类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">format[const</td><td>char *] 输出的格式化字符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>void </dd></dl>
<dl class="section pre"><dt>前置条件</dt><dd>level分级<ul>
<li>L_INFO 日常信息</li>
<li>L_WARNING 警告信息</li>
<li>L_ERROR 错误信息</li>
<li>L_FATAL 致命错误 </li>
</ul>
</dd>
<dd>
format格式<ul>
<li>使用printf 中的输出格式 e.g ("printf%s","hello") </li>
</ul>
</dd></dl>
<dl class="section remark"><dt>备注</dt><dd>可以分级写日志，写入到不同的文件里面。 </dd></dl>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0">gpl::logLevel</a> </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>inc/log/<a class="el" href="log_8h_source.html">log.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
